﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace DesignPaternFinder
{
    public partial class Form2 : Form
    {
        public Form2(double[,] matrix, List<string> list)
        {
            InitializeComponent();
            write(matrix, list);
            label3.Visible = false;
            label4.Visible = false;
            label5.Visible = false;
            label6.Visible = false;
        }
        public Form2(double[,] gen,double[,] asc, List<string> list)
        {
            InitializeComponent();
            label3.Visible = true;
            label4.Visible = true;
            label5.Visible = true;
            label6.Visible = true;
            write(gen,asc, list);
        }

        private void write(double[,] gen,double[,] asc, List<string> list)
        {
            label2.Text = "";
            label1.Text = "";
            label3.Text = "";
            label4.Text = "";
            foreach (string s in list)
            {
                label1.Text = label1.Text + s + "\n";
                label4.Text = label4.Text + s + "\n";
            }
            for (int i = 0; i < gen.GetLength(0); i++)
            {
                for (int j = 0; j < gen.GetLength(1); j++)
                {
                    label3.Text = label3.Text + " " + asc[i, j];
                    label2.Text = label2.Text + " " + gen[i, j];
                }
                label2.Text = label2.Text + "\n";
                label3.Text = label3.Text + "\n";
            }
        }

        private void write(double[,] matrix, List<string> list)
        {
            label2.Text = "";
            label1.Text = "";
            foreach (string s in list)
            {
                label1.Text =label1.Text+ s + "\n";
            }
            for (int i = 0; i < matrix.GetLength(0); i++)
            {
                for (int j = 0; j < matrix.GetLength(1); j++)
                {
                    label2.Text = label2.Text+ " " + matrix[i, j];
                }
                label2.Text = label2.Text + "\n";
            }
        }

        public void setTitle(string title)
        {
            this.Text = title;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Close();
        }
        
    }
}
